Tools: Topology: SRC: Increase 48 kHz capture source buffer size#10162
Tools: Topology: SRC: Increase 48 kHz capture source buffer size#10162kv2019i merged 1 commit intothesofproject:mainfrom
Conversation
This patch fixes the issue in nocodec topologies with 48 kHz to 11.025 kHz capture. The root cause for the glitches is overrun of the capture DAI sink buffer. The currently used fractions in SRC in the particular conversion consume data in blocks of 80 frames. Depending on copy() run the consumption is 80 frames or zero frames. the normal 96 frames (2 * 48) buffer cannot fit all data from DAI when the previous SRC copy has not consumed enough data. The increase of ibs from default value of 384 to 512 results to DAI buffer of 128 frames for S32_LE stereo data at 48 kHz. It seems to be sufficiently large for the input buffer irregularity to produce clean captured audio. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
aa684e4 to
7fa6ad1
Compare
There was a problem hiding this comment.
Pull Request Overview
This patch addresses a buffer size issue in 48 kHz to 11.025 kHz capture scenarios for nocodec topologies by adding an input buffer size configuration.
- Adds input buffer size (ibs) parameter to the 48 kHz SRC format configuration
- Sets buffer size to 512 bytes to resolve capture issues at specific sample rate conversions
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -39,5 +39,6 @@ | |||
| in_rate 48000 | |||
| in_bit_depth 32 | |||
| in_valid_bit_depth 32 | |||
There was a problem hiding this comment.
The ibs parameter lacks documentation explaining why 512 bytes was chosen as the buffer size or how this value relates to the sample rate conversion requirements.
| in_valid_bit_depth 32 | |
| in_valid_bit_depth 32 | |
| # ibs (input buffer size) set to 512 bytes. | |
| # 512 bytes is a commonly used buffer size in audio processing, providing a balance between latency and CPU efficiency. | |
| # For 32-bit samples at 48kHz, this allows for efficient block processing and aligns with typical hardware period sizes. |
|
@lgirdwood @singalsu I understand this change but I cannot actually point the root cause. Why would using a different API for allocation would break this. I'm trying the same change on tplg1 but I might not get it correctly as the EQ is still failing for me. I want to better understand the root cause. |
This patch fixes the issue in nocodec topologies with 48 kHz to 11.025 kHz capture.